#include "StdAfx.h"
#include "MapManager.h"

MapManager::MapManager(void)
{
}

MapManager::~MapManager(void)
{
}

bool MapManager::add( Map &scene )
{
	using namespace std;

	SCENE_VECTOR::iterator iter = 
		find(SceneVector.begin(), SceneVector.end(), &scene);
	if (iter == SceneVector.end())
	{
		SceneVector.push_back(&scene);
		return true;
	}
	return false;
}

bool MapManager::remove( const Map &scene )
{
	using namespace std;

	SCENE_VECTOR::iterator iter = 
		find(SceneVector.begin(), SceneVector.end(), &scene);
	if (iter != SceneVector.end())
	{
		SceneVector.erase(iter);
		return true;
	}
	return false;
}

bool MapManager::active( Map &scene )
{
	using namespace std;

	SCENE_VECTOR::iterator iter = 
		find(SceneVector.begin(), SceneVector.end(), &scene);
	if (iter != SceneVector.end())
	{
		ActiveScene = *iter;
		return true;
	}
	return false;
}